var LimFilter = new function () {
    var off = null;    //XY无效区间运行值，生命周期[limSta-limEnd]
    var flag = null;    //切分结果
    var lock = false;

    var handleProcessX = function () {};
    var handleProcessY = function () {};
    var handleEndX = function () {};
    var handleEndY = function () {};

    this.process = function(x, y) {
        if(lock) return;
        var X = Math.abs(x), Y = Math.abs(y);
        if(!flag && X + Y < 100) return;    //未筛选之前对 无效区间 进行识别

        if (!flag) flag = X > Y ? 'X' : 'Y';    //XY未做区分的话应第一时做好区分
        if(flag=='X') { if(!off) off = x; handleProcessX(x, off, x-off) }    //处理分支X
        if(flag=='Y'){ if(!off) off = y; handleProcessY(y, off, y-off) }    //处理分支Y
    };

    this.end = function(x, y, t) {
        if(lock) return;
        if(flag=='X'){ handleEndX(x, off, x-off, t) }    //处理X分支后续,滑屏的后续效果处理
        if(flag=='Y'){ handleEndY(y, off, y-off, t) }    //处理Y分支后续
        flag = off = null;    //XY区分周期结束/动作周期后清空记录
    };
    this.lock = function () { lock = true };
    this.unlock = function () { lock = false };
    this.handleX = function (P, E) { handleProcessX = P;  handleEndX = E || function () {} };
    this.handleY = function (P, E) { handleProcessY = P;  handleEndY = E || function () {} };
};